package com.gitee.wsl.concurrent.scheduler

/**
 * Base interface for schedulers.
 *
 * The following schedulers are provided by the library:
 * - [com.gitee.wsl.platform.scheduler.mainScheduler]
 * - [com.gitee.wsl.platform.scheduler.computationScheduler]
 * - [com.gitee.wsl.platform.scheduler.ioScheduler]
 * - [com.gitee.wsl.platform.scheduler.trampolineScheduler]
 * - [com.gitee.wsl.platform.scheduler.singleScheduler]
 * - [com.gitee.wsl.platform.scheduler.newThreadScheduler]
 */
interface Scheduler {

    /**
     * Creates a new instance of [SchedulerExecutor]. Throws an exception if [Scheduler] is destroyed.
     */
    fun newExecutor(): SchedulerExecutor

    /**
     * Destroys the scheduler
     */
    fun destroy()

    companion object
}
